const express = require("express");

const goodsController = require("../controller/goodsController");
const requireAuth = require("../middleware/requireAuth");
const router = express.Router({ mergeParams: true });

router
  .route("/")
  .get(requireAuth, goodsController.getGoodsByCompanyId) //获取某个公司下的商品
  .post(requireAuth, goodsController.createGoods);

router
  .route("/:id")
  .delete(goodsController.deleteGoods)
  .patch(requireAuth, goodsController.updateGoods);

router.route("/cal").post(goodsController.calculate);

module.exports = router;

module.exports = router;
